package LeetCode_206;

import java.util.List;

/**
 * @author : niu niu
 * @version : 1.0.0
 * @date : 2022/10/22 23:26
 */
public class Solution {
    public ListNode reverseList(ListNode head) {
        ListNode pre = null;
        ListNode cur = head;
        while (cur!=null){
            ListNode temp = cur.next;
            cur.next = pre;
            pre = cur;
            cur = temp;
        }
        return pre;
    }
}
